<?php 
/**
 * @version        $Id$
 * @author         master@xuewl.com
 * @copyright      Copyright (c) 2007 - 2014, Chongqing xuewl Information Technology Co., Ltd.
 * @link           http://www.xuewl.com
**/
use Common\Model\ModelModel;

function get_membernum_by_groupid($groupid = 0) {
	$groupid = (int) $groupid;
	return D('Member')->where(array('groupid' => $groupid))->count();
}
function addPoint($point,$userid){
	$model = M('member');
	$sql = "update tp_member set point = point + '$point' where userid = '$userid'";
	$rs = $model->query($sql);
	return $rs;
}
function addhit($id){
	$model = M('member_log');
	if(isset($id)){
		$sql = "update tp_member_log set hits = hits + 1 where logid = '$id'";
	}
	$result = $model->query($sql);
	return $result;
}